//app.js
App({
  onLaunch: function () {
    if (!wx.cloud) {

    } else {
      wx.cloud.init({
        env: 'yun-main-f1b43d',
        traceUser: true,
      })

      //判断是否为管理员进入
      wx.cloud.callFunction({
        name: 'login',
        success: res => {
          var openid = res.result.openid;
          if(openid == ""){
            wx.redirectTo({
              url: '/pages/manager/manager',
            })
          }else{
            wx.redirectTo({
              url: '/pages/index/index',
            })
          }
        }
      });
    }
  }
})
